<!DOCTYPE html>
<%-- <%@ include file="/WEB-INF/views/framework/common.jsp"%> --%>
<%-- sitemesh框架 全局引用 --%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- Jstl core tags -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%-- <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> --%>
<%-- <%@ taglib prefix="form" uri="/WEB-INF/tld/springside-form.tld"%> --%>

<!-- Spring security tags -->
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec"%>

<!-- Custom layout tags -->
<%@ taglib tagdir="/WEB-INF/tags/layouts" prefix="layout"%>
<%
    //应用上下文
	String path = request.getContextPath();
    //图片目录
    String image_path = path.concat("/static/images");
	//相对路径
	String cmpPath = request.getRequestURI(); //获取页面路径地址
	String resRoot = cmpPath.substring(0,cmpPath.lastIndexOf("/"))+"/";//获取资源的相对路径
	//为了便于spring mvc处理，将原始路径转换成 [/inner/] 映射下的路径,"inner"通过paper-context进行设置
	String cmpRoot = resRoot.replace("/WEB-INF/views/", "/inner/");//用于访问/WEB-INF/目录下的资源文件
	
	String sessionid = request.getSession().getId();
	// be careful overwriting: JSESSIONID may have been set with other flags
	//response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid + "; HttpOnly");
%>
<!-- 应用上下文 -->
<c:set value="<%=path%>" var="path" />
<!-- 图片资源根目录 -->
<c:set value="<%=image_path%>" var="image_path" />
<!-- [JSP用]相对路径：用于引用跟当前JSP同一目录下的js等资源文件 -->
<c:set value="<%=cmpRoot%>" var="cmpRoot" />
<!-- [JSP用]请求根目录：获取当前Controller的RootRequestMapping，用于向后台发起restful请求 -->
<c:set value="${path}${RootRequestMapping}" var="reqRoot" />

<!-- 引入全局CSS -->
<link rel="stylesheet" href="${path}/static/stylesheets/common.css" type="text/css" />
<link rel="stylesheet" href="${path}/static/lib/bootstrap-3.3.0-dist/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="${path}/static/lib/DataTables/css/jquery.dataTables.css" type="text/css" />
<link rel="stylesheet" href="${path}/static/stylesheets/zxx.lib.css" type="text/css" />
<!--[if lt IE 9]>
	<link type="text/css" rel="stylesheet" href="${path}/static/stylesheets/ie8.css"></link>
	<script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.min.js"></script>
	<script src="http://cdn.bootcss.com/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<!-- 引入全局javascript -->
<script type="text/javascript" src="${path}/static/lib/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="${path}/static/lib/bootstrap-3.3.0-dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${path}/static/lib/jquery.cookie.js"></script>
<script type="text/javascript">
	//前台获取当前页面相对路径
	//var div = document.createElement('div');
	//div.innerHTML = "<a href='./'></a>";
    var rep = "/WEB-INF/views/";
	var keter={
		context : '${path}',
		//由于某些页面有{pathVariable}，因此通过reqCmpRoot取到的JSP变量值不固定！
		reqRoot : '${reqRoot}', //模块当前路径：用于向服务端发起请求 
		//reqRoot : div.firstChild.href, //模块当前路径：用于向服务端发起请求 
		path : '${path}' //应用根目录
	};
	div = null;
</script>
<script type="text/javascript" src="${path}/static/lib/DataTables/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="${path}/static/lib/tyxzsp.debug.js"></script>
